#!/usr/bin/env python 
# -*- coding:utf-8 -*-
"""
@Time:2021/12/26 7:03 下午"
@Author:lydia_liu"
@File:addinput_page.py
@function:
输入姓名，手机号，点击保存
"""
from appium.webdriver.common.mobileby import MobileBy

from po_app_object.app_wechat_page.base.base import BasePage


class AddInputPage(BasePage):

    username_element = (MobileBy.XPATH, '//*[contains(@text,"姓名")]/../..//*[@text="必填"]')
    phone_element = (MobileBy.XPATH, '//*[contains(@text,"手机")]/..//*[@text="必填"]')
    save_element = (MobileBy.XPATH, '//*[@text="保存"]')
    def input_addmember(self,username,phone):
        from po_app_object.app_wechat_page.page.addcontent_page import AddContentPage
        self.find_send(*self.username_element,username)
        self.find_send(*self.phone_element, phone)
        self.find_click(*self.save_element)
        self.log_info("输入信息点击保存")
        # self.driver.find_element(MobileBy.XPATH, '//*[contains(@text,"姓名")]/../..//*[@text="必填"]').send_keys(username)
        # self.driver.find_element(MobileBy.XPATH, '//*[contains(@text,"手机")]/..//*[@text="必填"]').send_keys(phone)
        # self.driver.find_element(MobileBy.XPATH, '//*[@text="保存"]').click()

        return AddContentPage(self.driver)